package cn.sangedon.review.common.domain.bean;

import cn.sangedon.review.common.domain.data.TradingDate;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 交易日节点
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TradeDayNode implements Serializable {
    private static final long serialVersionUID = -973089542129303256L;

    /**
     * 当前交易日前一个交易日
     */
    private TradeDayNode pre;

    /**
     * 当前交易日后一个交易日
     */
    private TradeDayNode post;

    /**
     * 当前交易日
     */
    private TradingDate value;

    public TradeDayNode(TradingDate value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "TradeDayNode{" + "pre=" + pre == null ? "null" : pre.getValue().getTradingDate() + ", post=" + post == null ? "null" :
                                                                 post.getValue().getTradingDate() + ", value=" + value == null ? "null" :
                                                                 value.toString() + '}';
    }
}
